package com.gaoqi.springboot_shiro.config.Inteceptor;

import com.gaoqi.springboot_shiro.Inteceptor.JWTInteceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 自定义拦截器配置类 实现 WebMvcConfigurer 实现 addInterceptors方法
 */

@Configuration
public class InteceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JWTInteceptor());
        //添加拦截路径
//                    .addPathPatterns("/user/*")

        //放行路径
//                    .excludePathPatterns("/**");
    }
}
